/*
 * Copyright (c) 2022  by Junzhao
 * THIS FILE IS PART OF JAVASE Song Huongkang PROJECT
 * All Rights Reserved.
 */

package 练习;
/**
 * @description 将对象作为参数传递给方法
 * @author 俊昭
 * @date 2022/3/20
*/
public class test06 {
    public static void main(String[] args) {
        Circle c1 = new Circle();
        c1.radius = 2;
        test06 test = new test06();
        test.printAreas(c1,5);
        System.out.println("现在半径是"+c1.radius);
    }

    public void printAreas(Circle circle,int time){
        System.out.println("radius\tarea");

        for (int i =1;i<=time;i++){
            circle.radius =i;
            System.out.println(i+"\t\t"+ circle.findArea());
        }
        circle.radius = time +1;
    }

}
class Circle{
    double radius;// 半径

    public double findArea(){
        return radius*radius*Math.PI;
    }
}
